package com.example.xadmin.controller;


import com.example.xadmin.common.Result;
import com.example.xadmin.pojo.SysUser;
import com.example.xadmin.service.SysUserService;
import com.example.xadmin.util.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Administrator
 * @since 2020-04-05
 */
@Controller
@RequestMapping("/sys-user")
public class SysUserController {

    @Autowired
    private SysUserService service;

    @ResponseBody
    @PostMapping("/add")
    public Result add(SysUser sysUser,Integer roleId) throws Exception {
        service.saveEntity(sysUser,roleId);
        return Result.ok(1,null);
    }

}

